<template>
  <section class="h100 redPacket-panel">
    <van-row class="tab-panel">
        <van-row class="panel">
           <div :class="['item',activeKey===item.value&&'on']" v-for="(item,index) in tabs" :key="index" @click="onChange(item.value)">{{item.name}}</div>
        </van-row>
    </van-row>
    <van-row class="redPacket-list">
      <van-row class="panel">
         <div class="item" v-for="(item,index) in list" :key="index">
            <van-row class="content">
               <p class="money">+{{item.money}}元</p>
               <p>{{item.tips}}</p>
            </van-row>
            <van-row class="btns">
               <div class="option" v-if="item.status===1" @click="toDeatal">领取</div>
               <div class="option style-1" v-else>已领取</div>
            </van-row>
         </div>
      </van-row>
    </van-row>
  </section>
</template>

<script>
export default {
  data() {
    return {
       activeKey:1,
       tabs:[
         {
           name:'任务奖励',
           value:1
         },
         {
           name:'充值奖励',
           value:2
         }  
       ],
       list:[
        {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
        },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:2
        },
        {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
        },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
         },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
         },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
         },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
         },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
         },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
         },
         {
           money:'0.9',
           tips:'等级达到45级(平台用户专享)',
           status:1
         }
       ]
    }
  },
  created() {
 //  this.getLoad();
  },
  methods: {
    //初始化加载
    getLoad(){
        this.$http(`/basedata/common/getMenu`,{menuType:1},'get',false).then((res) => {
           
        })
    },
    //tab切换
    onChange(e) {
       this.activeKey=e;
    },
    //跳转到详情
    toDeatal(){
      this.$router.push('/redPacket/details');
    }
 
  }
};
</script>

<style lang='less'>
@import "../../assets/css/redPacket/index.less";
</style>
